package com.alienlab.finder.domain;


import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import javax.validation.constraints.*;

import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;

/**
 * A CheckTask.
 */
@Entity
@Table(name = "check_task")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class CheckTask implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @NotNull
    @Column(name = "admin_open_id", nullable = false)
    private String adminOpenId;

    @NotNull
    @Column(name = "guest_open_id", nullable = false)
    private String guestOpenId;

    @Column(name = "start_time")
    private ZonedDateTime startTime;

    @Column(name = "end_time")
    private ZonedDateTime endTime;

    @Column(name = "states_flag")
    private String statesFlag;

    @Column(name = "warning_id")
    private Long warningId;

    @Column(name = "origin_x")
    private String origin_x;

    @Column(name = "origin_y")
    private String origin_y;

    @Column(name = "distance")
    private String distance;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAdminOpenId() {
        return adminOpenId;
    }

    public CheckTask adminOpenId(String adminOpenId) {
        this.adminOpenId = adminOpenId;
        return this;
    }

    public void setAdminOpenId(String adminOpenId) {
        this.adminOpenId = adminOpenId;
    }

    public String getGuestOpenId() {
        return guestOpenId;
    }

    public CheckTask guestOpenId(String guestOpenId) {
        this.guestOpenId = guestOpenId;
        return this;
    }

    public void setGuestOpenId(String guestOpenId) {
        this.guestOpenId = guestOpenId;
    }

    public ZonedDateTime getStartTime() {
        return startTime;
    }

    public CheckTask startTime(ZonedDateTime startTime) {
        this.startTime = startTime;
        return this;
    }

    public void setStartTime(ZonedDateTime startTime) {
        this.startTime = startTime;
    }

    public ZonedDateTime getEndTime() {
        return endTime;
    }

    public CheckTask endTime(ZonedDateTime endTime) {
        this.endTime = endTime;
        return this;
    }

    public void setEndTime(ZonedDateTime endTime) {
        this.endTime = endTime;
    }

    public String getStatesFlag() {
        return statesFlag;
    }

    public CheckTask statesFlag(String statesFlag) {
        this.statesFlag = statesFlag;
        return this;
    }

    public void setStatesFlag(String statesFlag) {
        this.statesFlag = statesFlag;
    }

    public Long getWarningId() {
        return warningId;
    }

    public CheckTask warningId(Long warningId) {
        this.warningId = warningId;
        return this;
    }

    public void setWarningId(Long warningId) {
        this.warningId = warningId;
    }

    public String getOrigin_x() {
        return origin_x;
    }

    public void setOrigin_x(String origin_x) {
        this.origin_x = origin_x;
    }

    public String getOrigin_y() {
        return origin_y;
    }

    public void setOrigin_y(String origin_y) {
        this.origin_y = origin_y;
    }

    public String getDistance() {
        return distance;
    }

    public void setDistance(String distance) {
        this.distance = distance;
    }


    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CheckTask checkTask = (CheckTask) o;
        return Objects.equals(id, checkTask.id) &&
            Objects.equals(adminOpenId, checkTask.adminOpenId) &&
            Objects.equals(guestOpenId, checkTask.guestOpenId) &&
            Objects.equals(startTime, checkTask.startTime) &&
            Objects.equals(endTime, checkTask.endTime) &&
            Objects.equals(statesFlag, checkTask.statesFlag) &&
            Objects.equals(warningId, checkTask.warningId) &&
            Objects.equals(origin_x, checkTask.origin_x) &&
            Objects.equals(origin_y, checkTask.origin_y) &&
            Objects.equals(distance, checkTask.distance);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, adminOpenId, guestOpenId, startTime, endTime, statesFlag, warningId, origin_x, origin_y, distance);
    }

    @Override
    public String toString() {
        return "CheckTask{" +
            "id=" + id +
            ", adminOpenId='" + adminOpenId + '\'' +
            ", guestOpenId='" + guestOpenId + '\'' +
            ", startTime=" + startTime +
            ", endTime=" + endTime +
            ", statesFlag='" + statesFlag + '\'' +
            ", warningId=" + warningId +
            ", origin_x='" + origin_x + '\'' +
            ", origin_y='" + origin_y + '\'' +
            ", distance='" + distance + '\'' +
            '}';
    }
}
